Oracle RMAN 11g Backup and Recovery by Robert Freeman
Author:Robert Freeman [Freeman, Robert]
Language: eng
Format: epub
Publisher: McGraw-Hill Osborne Media
Published: 2010-04-22T07:00:00+00:00
296 Part II: Setup Principles and Practices
If the logfile you are trying to clear has not been archived, you may get the following error: SQL> alter database clear logfile group 1;
alter database clear logfile group 1
*
ERROR at line 1:
ORA-00350: log 1 of instance orcl (thread 1) needs to be archived
ORA-00312: online log 1 thread 1: '/oracle01/oradata/dance/redo01.log'
Of course, since the logfile is not there, it cannot be archived. In this case, we use the alter database clear unarchived logfile command to clear the unarchived log file and rebuild the log file in its current location, as seen here:
SQL> alter database clear unarchived logfile '/oracle01/oradata/dance/redo01.log'; You will need to back up your database in this case, since an archived redo log will have been lost.
In some cases, the database will not crash, but will freeze. If this occurs, open another SQL*Plus session and connect to the database. Then issue the alter database checkpoint command followed by either the alter database clear logfile or the alter database clear unarchived logfile command, depending on the type of recovery required. After you issue these commands, the database should operate as usual.
Loss of an Active but Not Current Online Redo Log Group
If you suffer the loss of an active online redo log group, you will need to use the alter database clear unarchived logfile command as shown in the previous section. This is because the active online redo log will not have been archived, and you need to indicate to Oracle that this is okay.
This command will rebuild the online redo log and allow Oracle to proceed with normal operations.
You should always back up the database after this operation.
Loss of the Current Online Redo Log Group
If you want to have a bad day, losing the current online redo log group probably would do it for you. If you have lost the current online redo log group, you probably will experience some loss of data. When you lose the current online redo log group, you can expect that the database will shut down, and not in the normal, pleasant kind of way that you would like.
If you are lucky and the database has not yet shut down, you should immediately attempt to reduce the overall loss of data by checkpointing the database using the alter system checkpoint command, and then shut down the database afterward as soon as practical. The alter system checkpoint command forces the database to write any dirty blocks from the database buffer cache to the database datafiles.
You may be able to open the database without any recovery being required. To try to restart the database:
1. Issue the startup mount command.
2. Issue the alter database clear unarchived logfile command for the redo log group that was lost. Examples of this command can be seen in earlier sections of this chapter.
3. Issue the alter database open command.
If the database opens successfully, you are in luck and a celebration is warranted.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8309)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6788)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6765)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6648)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6437)
Driving Data Quality with Data Contracts by Andrew Jones(6376)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6137)
Learning SQL by Alan Beaulieu(6003)
Weapons of Math Destruction by Cathy O'Neil(5795)
Big Data Analysis with Python by Ivan Marin(5388)
Data Engineering with dbt by Roberto Zagni(4391)
Solidity Programming Essentials by Ritesh Modi(4041)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3899)
Pandas Cookbook by Theodore Petrou(3600)
Blockchain Basics by Daniel Drescher(3305)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2914)
Feature Store for Machine Learning by Jayanth Kumar M J(2819)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2802)
Mastering Python for Finance by Unknown(2748)
